﻿using Microsoft.Exchange.WebServices.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EWSEditor.CRM
{
    class EWSHelpers
    {
        public static string GetFolderIdFromInt(string folderId, ExchangeService _exchangeproxy)
        {
            if (folderId == "0")
            {
                Folder calendar = Folder.Bind(_exchangeproxy, WellKnownFolderName.Calendar);
                return calendar.Id.ToString();
            }

            else if (folderId == "1")
            {
                Folder contacts = Folder.Bind(_exchangeproxy, WellKnownFolderName.Contacts);
                return contacts.Id.ToString();
            }

            else
            {
                Folder tasks = Folder.Bind(_exchangeproxy, WellKnownFolderName.Tasks);
                return tasks.Id.ToString();
            }
        }
    }
}
